package com.stylefeng.guns.generator.engine.config;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * Warpper模板生成的配置
 *
 * @author fengshuonan
 * @date 2017-05-07 22:12
 */
@Data
public class WarpperConfig {

    private ContextConfig contextConfig;

    private String warpperPathTemplate;

    private String packageName;

    private List<String> imports;

    public void init() {
        ArrayList<String> imports = new ArrayList<>();
        imports.add("com.stylefeng.guns.core.base.warpper.BaseControllerWarpper");
        imports.add("java.util.List");
        imports.add("java.util.Map");
        this.imports = imports;

        this.warpperPathTemplate = "\\src\\main\\java\\" + contextConfig.getProPackage().replaceAll("\\.", "\\\\") + "\\modular\\" + contextConfig.getModuleName() + "\\warpper\\{}Warpper.java";
        this.packageName = contextConfig.getProPackage() + ".modular." + contextConfig.getModuleName() + ".warpper";
    }

}
